package com.lvyq.javaprint.util;

import com.lvyq.javaprint.MainWinApplication;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.net.URL;

/**
 * @author lvyq
 * @version 1.0
 * Create by 2024-05-14 14:39
 */
public class CommonUtils {

    /**
     * @description 读取图片
     * @author lvyq
     * @param[1] path
     * @throws
     * @return Image
     * @time 2024-04-24 17:33
     */
    public static java.awt.Image getImage(String path){
        URL url= MainWinApplication.class.getClassLoader().getResource(path);
        BufferedImage image=null;
        try {
            image= ImageIO.read(url);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return image;
    }





}
